package com.yuanfengPlus.inventory.service.impl;


import com.yuanfengPlus.inventory.dao.IInventoryDao;
import com.yuanfengPlus.inventory.entity.Inventory;
import com.yuanfengPlus.inventory.service.IInventoryService;
import com.yuanfengPlus.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class InventoryServiceImpl implements IInventoryService {
    @Autowired
    private IInventoryDao iid;
    //根据不同查询条件查询库存信息
    @Override
    public Result<List<Inventory>> queryInventory(Map<String, Object> params) {
        List<Inventory> inventoryList = iid.queryInventory(params);
        if (!inventoryList.isEmpty()) {
            return Result.success(inventoryList);
        }
        return Result.failure(400, "暂无数据");
    }

}
